package cn.tjnext.apply.entity;

import cn.tjnext.apply.contants.EntityStatus;
import org.springframework.data.domain.Sort;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by cp on 2017/8/7.
 */
@Entity
@Table(name = "t_admin")
public class AdminEntity extends AbstractEntity {

    private static final long serialVersionUID = -8105740602690598111L;
    public static final Sort DEFAULT_SORTING = new Sort(Sort.Direction.DESC, "create_time");

    @Id
    @Column(name = "pkid")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long pkId;

    @Column(name = "account")
    private String account;

    @Column(name = "password")
    private String password;

    @Column(name = "last_time")
    private Date lastTime;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "status")
    private Integer status = EntityStatus.NORMAL;

    @Override
    public Long getPkId() {
        return pkId;
    }

    @Override
    public void setPkId(Long pkId) {
        this.pkId = pkId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getLastTime() {
        return lastTime;
    }

    public void setLastTime(Date lastTime) {
        this.lastTime = lastTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String stoString() {
        return "AdminEntity{" +
                "DEFAULT_SORTING=" + DEFAULT_SORTING +
                ", pkId=" + pkId +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", lastTime=" + lastTime +
                ", createTime=" + createTime +
                ", status=" + status +
                '}';
    }
}
